<?php
namespace App\Http\Controllers\BankAcount;

use App\Http\Controllers\Controller;
use App\Exceptions\APIHttpException;
use App\Http\Model\BankAcount\SuperviseAccountFlowModel;
use App\Http\Model\Common\BusinessModel;
use App\Http\Middleware\Auth;

/*监管账户流水*/
class SuperviseAccountFlow extends Controller
{
    /*5.1-监管账户流水列表*/
    public function index(){
        $input = $this->_auth();
        $func = __FUNCTION__;
        $ret = SuperviseAccountFlowModel::$func($input);
        return APIHttpException::success($ret);
    }
    /*导出*/
    public function export(){
        $input = $this->_auth();
        SuperviseAccountFlowModel::index($input);
    }
    /*
     * 处理权限
     */
    private function _auth(){

        $input = request()->all();

        $pfs_dw_id = Auth::pfs([$input['pfs_dw_id']], 0);
        if(empty($pfs_dw_id)){
            throw new APIHttpException('没有权限~');
        }
        /*监管银行账号组*/
        $input['pfs_dw_id'] = explode(',',$pfs_dw_id);

        return $input;
    }
}
